package com.tomise.demo.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.tomise.core.page.Page;
import com.tomise.demo.bean.FootBean;
import com.tomise.demo.dao.FootDao;

@Service("FootService")
@Transactional
public class FootService {
	@Autowired
	private FootDao footDao;

	/**
	 * 分页方法
	 * @param page 当前页
	 * @param rows 大小
	 * @param select 查询列
	 * @param tableWhere 查询表和where
	 * @param orderBy 排序 
	 * @param array 参数
	 * @return
	 */
	public Page page(Integer page, Integer rows, String select,
			String tableWhere, String orderBy, Object[] array) {
		return this.footDao.page(page,rows,select,tableWhere,orderBy,array);
	}
	
	
	public List<FootBean> getFootList(){
		return this.footDao.selectList("com.tomise.demo.foot.getFootList");
	}

	public void saveFootBean(FootBean bean) {
		this.footDao.save("com.tomise.demo.foot.saveFootBean",bean);
	}


	public void batchDelete(List<Object> list) {
		this.footDao.delete("com.tomise.demo.foot.batchDelete",list);
	}


	public void delete(String id) {
		this.footDao.delete("com.tomise.demo.foot.delete",id);
	}


	public FootBean getFootBeanById(String id) {
		return this.footDao.selectOne("com.tomise.demo.foot.getFootBeanById",id);
	}


	public void updateFootBean(FootBean bean) {
		this.footDao.update("com.tomise.demo.foot.updateFootBean",bean);
	}
}
